﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HFController;
using System.Web.SessionState;
using System.Web.Script.Serialization;

namespace HFWebApp.AjaxSource
{
    /// <summary>
    /// FindPassword 的摘要说明
    /// </summary>
    public class FindPassword : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            BagePages bp = new BagePages();
            string uid = bp.GetQuery("uid");
            string typeid = bp.GetQuery("typeid");
            HFModel.ResultModel result = UserController.getController().FindPassword(uid, typeid);
            context.Response.Write(this.getJSONResult(result));
            context.Response.End();
        }
        protected string getJSONResult(HFModel.ResultModel result)
        {
            JavaScriptSerializer jsSerializer = new JavaScriptSerializer(new SimpleTypeResolver());
            return jsSerializer.Serialize(result);
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}